derivative of a rational function